<?php /* Smarty version 2.6.16, created on 2011-09-27 16:27:16
         compiled from inbox.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'count', 'inbox.tpl', 124, false),)), $this); ?>
<?php echo '
<script language="javascript">
function showPostbox(message_id)
{	
	$(\'.post-box\').hide();	
	$(\'#reply_\'+message_id).hide();
	$(\'#post_box_\'+message_id).slideDown();	
}
function hidePostbox(message_id)
{	
	var message_text=$(\'#message_text_\'+message_id).val();
	if(message_text == ""){
		$(\'#message_text_\'+message_id).css(\'border\',\'1px solid #FF0000\');
		return false;
	}	
	else{
		$(\'#message_text_\'+message_id).css(\'border\',\'1px solid #000\');
		$(\'.post-box\').hide();	
		$(\'#reply_\'+message_id).show();	
		var message_id=message_id;
		submit_message_text(message_id)
	}	
	
}
function submit_message_text(message_id)
{	
	var message_text=$(\'#message_text_\'+message_id).val();
	var user_id_to=$(\'#user_id_to_\'+message_id).val();	
	var reply_of_msg=$(\'#reply_of_msg_\'+message_id).val();
		
	
	
	$.ajax({
		   url:\'reply.php\',
		   data:\'flag=1&message_text=\'+message_text+\'&reply_of_msg=\'+reply_of_msg+\'&user_id_to=\'+user_id_to,
		   type:\'post\',		  
		   success:function(resp){
		   //alert(resp);		   	
			    $(\'#reply_content_\'+message_id).html(resp);											
		   } 		   
	});
		$(\'#show_post_lnk_\'+message_id).html(\'<a href="javascript:;" onclick="open_content(\'+message_id+\')">PostBox</a>\');
		
	document.getElementById("message_text_"+message_id).value=\'\';
	
}
function open_content(message_id)
{	
	if ($(\'#reply_content_\'+message_id).css(\'display\') == "none")
		$(\'#reply_content_\'+message_id).slideDown();	
	else
		$(\'#reply_content_\'+message_id).slideUp();	
}
</script>
'; ?>

<?php if ($this->_tpl_vars['IsProcess'] != 'Y'): ?>
	<div class="content">
   		<!-- tab -->
    	<ul class="tabflex">
        	<li><a href="dashboard.php" ><span>Dashboard</span></a></li>
          <li><a href="javascript:;" class="active"><span>Message</span></a></li>
        </ul>
        <!-- tab -->
        <div class="clear"></div>
        <div class="tabular-content">
            <div class="tab_sub">
            	<ul>
                	<li><a href="javascript:;" class="active">Inbox</a></li>
                    <li><a href="send_item.php">Sent Items</a></li>
                </ul>
            </div>
            <div class="tab_search">
            	<form name="search" id="Search" action="">
                <fieldset>
                	<label for="Search"><input type="text" name="search" id="Search" /></label>
                    <label for="Search_Button"><input type="submit" value="Search" name="search_btn" id="search_btn" class="search_btn" /></label>
                </fieldset>
                </form>
            </div>
            <!--<div class="tab_pagination">
            	<span class="page-records"><strong>1 - 20 of 60</strong></span> 
				<span class="left-arr"><a href="#"></a></span>
				<span class="right-arr"><a href="#"></a></span>
            </div>  --> 
			 
            <br />
            <div class="tab_sub">
            	&nbsp;
            </div>
            <div class="tab_search">
            	&nbsp;
            </div>
              
            <div class="clear"></div> 
		
		<div id="paging">
            
  <?php endif; ?>          
     <div class="tab_pagination">
            	<?php if ($this->_tpl_vars['pagination_arr'][1]): ?>
				 <div class="clear"></div>
				  <div class="pagin">
					 <ul>
					   <?php echo $this->_tpl_vars['pagination_arr'][1]; ?>

					 </ul>
				  </div>
				 <?php endif; ?>
            </div>         
            <!-- details page block start here -->
			<?php unset($this->_sections['msg']);
$this->_sections['msg']['name'] = 'msg';
$this->_sections['msg']['loop'] = is_array($_loop=$this->_tpl_vars['latest_msgArr']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['msg']['show'] = true;
$this->_sections['msg']['max'] = $this->_sections['msg']['loop'];
$this->_sections['msg']['step'] = 1;
$this->_sections['msg']['start'] = $this->_sections['msg']['step'] > 0 ? 0 : $this->_sections['msg']['loop']-1;
if ($this->_sections['msg']['show']) {
    $this->_sections['msg']['total'] = $this->_sections['msg']['loop'];
    if ($this->_sections['msg']['total'] == 0)
        $this->_sections['msg']['show'] = false;
} else
    $this->_sections['msg']['total'] = 0;
if ($this->_sections['msg']['show']):

            for ($this->_sections['msg']['index'] = $this->_sections['msg']['start'], $this->_sections['msg']['iteration'] = 1;
                 $this->_sections['msg']['iteration'] <= $this->_sections['msg']['total'];
                 $this->_sections['msg']['index'] += $this->_sections['msg']['step'], $this->_sections['msg']['iteration']++):
$this->_sections['msg']['rownum'] = $this->_sections['msg']['iteration'];
$this->_sections['msg']['index_prev'] = $this->_sections['msg']['index'] - $this->_sections['msg']['step'];
$this->_sections['msg']['index_next'] = $this->_sections['msg']['index'] + $this->_sections['msg']['step'];
$this->_sections['msg']['first']      = ($this->_sections['msg']['iteration'] == 1);
$this->_sections['msg']['last']       = ($this->_sections['msg']['iteration'] == $this->_sections['msg']['total']);
?>
            	<div class="comment-container">				
                	<div>
					<?php if ($this->_tpl_vars['latest_msgArr'][$this->_sections['msg']['index']]['photo'] != ''): ?>
                        <div class="message-thumb"><img src="uploaded/user_images/thumbs/mid_<?php echo $this->_tpl_vars['latest_msgArr'][$this->_sections['msg']['index']]['photo']; ?>
" width="57" height="50" alt="" border="0" /></div>				<?php else: ?>
						<div class="message-thumb"><img src="images/avatar_small.jpg" width="57" height="50" alt="" border="0" /></div>
					<?php endif; ?>
                        <div class="message-details">
                        	<h3><?php echo $this->_tpl_vars['latest_msgArr'][$this->_sections['msg']['index']]['name']; ?>
</h3>
                            <span class="message-date"><?php echo $this->_tpl_vars['latest_msgArr'][$this->_sections['msg']['index']]['date_add']; ?>
</span>
                            <br />
                        	<?php echo $this->_tpl_vars['latest_msgArr'][$this->_sections['msg']['index']]['message_text']; ?>

                        </div>
						<div id="show_post_lnk_<?php echo $this->_tpl_vars['latest_msgArr'][$this->_sections['msg']['index']]['message_id']; ?>
">
						<?php if (count($this->_tpl_vars['latest_msg_subArr'][$this->_sections['msg']['index']]) > 0): ?>
						<a href="javascript:;" onclick="open_content(<?php echo $this->_tpl_vars['latest_msgArr'][$this->_sections['msg']['index']]['message_id']; ?>
)">PostBox</a>
						<?php endif; ?>
						</div>
                        <div class="clear"></div>
                        <!-- post -->
						<?php if (count($this->_tpl_vars['latest_msg_subArr'][$this->_sections['msg']['index']]) > 0): ?>
						<div id="reply_content_<?php echo $this->_tpl_vars['latest_msgArr'][$this->_sections['msg']['index']]['message_id']; ?>
" style="display:none;">								
						<?php unset($this->_sections['msg1']);
$this->_sections['msg1']['name'] = 'msg1';
$this->_sections['msg1']['loop'] = is_array($_loop=$this->_tpl_vars['latest_msg_subArr'][$this->_sections['msg']['index']]) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['msg1']['show'] = true;
$this->_sections['msg1']['max'] = $this->_sections['msg1']['loop'];
$this->_sections['msg1']['step'] = 1;
$this->_sections['msg1']['start'] = $this->_sections['msg1']['step'] > 0 ? 0 : $this->_sections['msg1']['loop']-1;
if ($this->_sections['msg1']['show']) {
    $this->_sections['msg1']['total'] = $this->_sections['msg1']['loop'];
    if ($this->_sections['msg1']['total'] == 0)
        $this->_sections['msg1']['show'] = false;
} else
    $this->_sections['msg1']['total'] = 0;
if ($this->_sections['msg1']['show']):

            for ($this->_sections['msg1']['index'] = $this->_sections['msg1']['start'], $this->_sections['msg1']['iteration'] = 1;
                 $this->_sections['msg1']['iteration'] <= $this->_sections['msg1']['total'];
                 $this->_sections['msg1']['index'] += $this->_sections['msg1']['step'], $this->_sections['msg1']['iteration']++):
$this->_sections['msg1']['rownum'] = $this->_sections['msg1']['iteration'];
$this->_sections['msg1']['index_prev'] = $this->_sections['msg1']['index'] - $this->_sections['msg1']['step'];
$this->_sections['msg1']['index_next'] = $this->_sections['msg1']['index'] + $this->_sections['msg1']['step'];
$this->_sections['msg1']['first']      = ($this->_sections['msg1']['iteration'] == 1);
$this->_sections['msg1']['last']       = ($this->_sections['msg1']['iteration'] == $this->_sections['msg1']['total']);
?>	                        				 	
                            <div class="message-post">
							<?php if ($this->_tpl_vars['latest_msg_subArr'][$this->_sections['msg']['index']][$this->_sections['msg1']['index']]['photo'] != ''): ?>
                            <div class="message-thumb"><img src="uploaded/user_images/thumbs/mid_<?php echo $this->_tpl_vars['latest_msg_subArr'][$this->_sections['msg']['index']][$this->_sections['msg1']['index']]['photo']; ?>
" width="57" height="50" alt="" border="0" /></div>			<?php else: ?>
							<div class="message-thumb"><img src="images/avatar_smallest.jpg" border="0" alt="" /></div>
							<?php endif; ?>
							<div style="float:left; display:block; width:380px;">
                            <h3><?php echo $this->_tpl_vars['latest_msg_subArr'][$this->_sections['msg']['index']][$this->_sections['msg1']['index']]['name']; ?>
</h3>
                            <span class="message-date"><?php echo $this->_tpl_vars['latest_msg_subArr'][$this->_sections['msg']['index']][$this->_sections['msg1']['index']]['date_add']; ?>
</span>
                            <br />                            
                          <?php echo $this->_tpl_vars['latest_msg_subArr'][$this->_sections['msg']['index']][$this->_sections['msg1']['index']]['message_text']; ?>
</div>
                            <div class="clear"></div>
                            </div>
                            <div class="message-post-bottom"></div>
                            <div class="clear"></div>
                        
						<?php endfor; endif; ?>
						<div class="clear"></div>                        
                        <p class="button-flex" id="reply_<?php echo $this->_tpl_vars['latest_msgArr'][$this->_sections['msg']['index']]['message_id']; ?>
"><a href="javascript:;" onclick="showPostbox(<?php echo $this->_tpl_vars['latest_msgArr'][$this->_sections['msg']['index']]['message_id']; ?>
)"><span>Reply</span></a></p>
						</div>
						<?php else: ?>
						<div id="reply_content_<?php echo $this->_tpl_vars['latest_msgArr'][$this->_sections['msg']['index']]['message_id']; ?>
" style="display:none;">	
							<div class="message-post-bottom"></div>
                            <div class="clear"></div>							
						 <div class="clear"></div>
                        
                        <p class="button-flex" id="reply_<?php echo $this->_tpl_vars['latest_msgArr'][$this->_sections['msg']['index']]['message_id']; ?>
"><a href="javascript:;" onclick="showPostbox(<?php echo $this->_tpl_vars['latest_msgArr'][$this->_sections['msg']['index']]['message_id']; ?>
)"><span>Reply</span></a></p>
						</div> 
						<?php endif; ?>						
                        <!-- post -->                        
                       	<div class="clear"></div>
						<br />
                        <div class="clear"></div>
                        <div class="post-box" style='display:none' id="post_box_<?php echo $this->_tpl_vars['latest_msgArr'][$this->_sections['msg']['index']]['message_id']; ?>
">						
                        	<textarea rows="5" cols="10" id="message_text_<?php echo $this->_tpl_vars['latest_msgArr'][$this->_sections['msg']['index']]['message_id']; ?>
"></textarea>
							<input name="user_id_to_<?php echo $this->_tpl_vars['latest_msgArr'][$this->_sections['msg']['index']]['message_id']; ?>
" id="user_id_to_<?php echo $this->_tpl_vars['latest_msgArr'][$this->_sections['msg']['index']]['message_id']; ?>
" type="hidden" value="<?php echo $this->_tpl_vars['latest_msgArr'][$this->_sections['msg']['index']]['user_id_to']; ?>
" />							
							<input name="reply_of_msg_<?php echo $this->_tpl_vars['latest_msgArr'][$this->_sections['msg']['index']]['message_id']; ?>
" id="reply_of_msg_<?php echo $this->_tpl_vars['latest_msgArr'][$this->_sections['msg']['index']]['message_id']; ?>
" type="hidden" value="<?php echo $this->_tpl_vars['latest_msgArr'][$this->_sections['msg']['index']]['message_id']; ?>
" /> 
                            <br />
                            <br />
                             <p class="button-flex" id="post"><a href="javascript:;" onclick="hidePostbox(<?php echo $this->_tpl_vars['latest_msgArr'][$this->_sections['msg']['index']]['message_id']; ?>
)"><span>Post</span></a></p>
                              <div class="clear"></div>
                        </div>
                        
                         <div class="clear"></div>
                    </div>
                    
                </div>
			<?php endfor; endif; ?>
            <!-- details page block start here -->           
<?php if ($this->_tpl_vars['IsProcess'] != 'Y'): ?>
		</div>
        </div>
    </div>
<?php endif; ?>